import java.util.Scanner;

public class ComplexApp {
    public static void main(String[] args){
        Scanner input=new Scanner(System.in);
        System.out.print("Enter complex number 1 (real and imaginary part):");
        Complex complex1=new Complex(input.nextDouble(),input.nextDouble());
        System.out.print("Enter complex number 2 (real and imaginary part):");
        Complex complex2=new Complex(input.nextDouble(),input.nextDouble());
        printComplex(complex1);
        printComplex(complex2);
        if(complex1.equals(complex2)){
            System.out.println(complex1+" is equal to "+complex2);
        }
        else {
            System.out.println(complex1+" is NOT equal to "+complex2);
        }
        System.out.println(complex1+" + "+complex2+" = "+complex1.add(complex2));
    }
    public static void printComplex(Complex complex){
        System.out.println("Number 1 is:"+complex);
        if(complex.isReal()){
            System.out.println(complex+" is a pure real number");
        }
        else {
            System.out.println(complex+" is NOT a pure real number");
        }
        if(complex.isReal()){
            System.out.println(complex+" is a pure real number");
        }
        else {
            System.out.println(complex+" is NOT a pure real number");
        }
    }
}
